<?php

namespace addons\mental\controller;

use app\admin\model\Exchangecode;
use app\admin\model\xlzxinfo\Certificate;
use app\admin\model\xlzxinfo\Tags;
use app\admin\model\xlzxinfo\Package;
use app\admin\model\xlzxinfo\Xlzxinfo as XizxinfoModel;
use app\common\library\Ims;
use app\common\model\Area;
use think\Config;
use think\Db;
/**
 * 心里咨询师
 */
class Xlzxinfo extends Base
{
    protected $noNeedLogin = ['xlzxinfo_list','details','details_zxs','typelist','tagslist','certificatelist','send_message','every_message','package_isset','assessment'];
    
    
    
    /**
     * 申请心里咨询师(addons/mental/xlzxinfo/save)
     * @param string $typeStr 申请类型
     * @param string $isExp 是否有相关经验:0=否,1=是
     * @param string $tags tags
     * @param string $image 图像
     * @param string $full_name 姓名
     * @param string $gender 性别:1=男,2=女
     * @param string $id_number 身份证号
     * @param string $phone 手机号
     * @param string $certificate_image 证书
     * @param string $address 地址
     */
    public function save()
    {
        $uid = $this->auth->id;
        
        $typeStr = $this->request->post('typeStr');
        $isExp = $this->request->post('isExp');
        $tags = $this->request->post('tags');
        $certificate = $this->request->post('certificate');
        $image = $this->request->post('image');
        $id_number_pic_zheng = $this->request->post('id_number_pic_zheng');
        $id_number_pic_fan = $this->request->post('id_number_pic_fan');
        $full_name = $this->request->post('full_name');
        $gender = $this->request->post('gender');
        $id_number = $this->request->post('id_number');
        $phone = $this->request->post('phone');
        $certificate_image = $this->request->post('certificate_image');
        $address = $this->request->post('address');
        $province = $this->request->param('province');
        $city = $this->request->param('city');
        $des = $this->request->param('des');
        $experience = $this->request->param('experience');

        $data = Db::name('mental_xlzxinfo')->where('user_id',$uid)->find();
        
        $typeId = Db::name('mental_xlzxinfo_type')->where('name',$typeStr)->value('id');
        $arr = [
            'user_id'=>$uid,
            'typeId'=>$typeId??0,
            'typeStr'=>$typeStr,
            'isExp'=>$isExp,
            'tags'=>$tags,
            'certificate'=>$certificate,
            'image'=>$image,
            'id_number_pic_zheng'=>$id_number_pic_zheng,
            'id_number_pic_fan'=>$id_number_pic_fan,
            'full_name'=>$full_name,
            'gender'=>$gender,
            'id_number'=>$id_number,
            'phone'=>$phone,
            'certificate_image'=>$certificate_image,
            'province'=>$province,
            'des'=>$des,
            'experience'=>$experience,
            'address'=>$address,
            'city'=>$city,
            'status'=>0,
            'updatetime'=>time(),
            'reason'=>'',
            ];


        if ($data) {
            if ($data['status'] == 0) {
                $this->error('待审核,请勿重复提交');
            }
            if ($data['status'] == 1) {
                $this->error('审核已通过,请勿重复提交');
            }
            
            $ret = Db::name('mental_xlzxinfo')->where('id',$data['id'])->update($arr);
        }else {
            $arr['createtime'] = time();
            $ret = Db::name('mental_xlzxinfo')->insert($arr);
        }
        
        
        if ($ret) {
            $user_info = Db::name('user')->where('id',$uid)->find();
            $user = [
                'id'=>$uid,
                'nickname'=>$user_info['nickname'],
                'avatar'=>$user_info['avatar'],
            ];
            $ret = \addons\mental\model\WxUser::im_update($user);
            $this->success('提交成功');
        }
        $this->error('失败');
        
    }
    
    /**  根据咨询师  用户滴查询详情
     * 心里咨询师信息详情(addons/mental/xlzxinfo/details)
     * @param int $id 咨询师id,传了是查看别人的,不传是查看自己的
     */
    public function details()
    {
        $uid = $this->request->param('id');
        if (!$uid) {
            $uid = $this->auth->id;
        }

        $data = Db::name('mental_xlzxinfo')->where('user_id',$uid)->find();
        if(empty($data)){
            $this->error();
        }
        $user = \app\common\model\User::where(['id'=>$data['user_id']])->find();
        $data['official_openid'] = $user['official_openid'];

        $data['province_text'] = Area::where(['id'=>$data['province']])->value('name');
        $data['city_text'] = Area::where(['id'=>$data['city']])->value('name');

        //擅长领域
        $tags_arr = explode(',',$data['tags']);
        $data['tags_text'] = $tags_arr? Tags::whereIn('id',$tags_arr)->column('name'):[];
        //资质证书
        $certificate_arr = explode(',',$data['certificate']);
        $data['certificate_text'] = $certificate_arr? Certificate::whereIn('id',$certificate_arr)->column('name'):[];
//        $data['people_num'] = Exchangecode::where(['zx_xlzxinfoid'=>$data['id'],'status'=>1])->count();
//        $people_hour = Exchangecode::where(['zx_xlzxinfoid'=>$data['id'],'status'=>1])->sum('zx_minutes');
//        $data['people_hour'] = bcMath($people_hour,60,'/',1);

        $data['image'] = compatImage($data['image']);
        $data['id_number_pic_zheng'] = !empty($data['id_number_pic_zheng']) ? compatImage($data['id_number_pic_zheng']):'';
        $data['id_number_pic_fan'] = !empty($data['id_number_pic_fan']) ? compatImage($data['id_number_pic_fan']):'';

        //people_num 咨询人数
        $data['people_num'] = Db::name('consult_order')->where(['status'=>3,'xlzxinfo_id'=>$data['id']])->count();
        //people_hour 咨询时长
        $data['people_hour'] = Db::name('consult_order')->where(['status'=>3,'xlzxinfo_id'=>$data['id']])->sum('minutes');

        $this->success('成功',$data);
    }


    /**  根据咨询师id  滴查询详情
     * 心里咨询师信息详情(addons/mental/xlzxinfo/details)
     * @param int $id 咨询师id,传了是查看别人的,不传是查看自己的
     */
    public function details_zxs()
    {
        $id = $this->request->param('id');
        $data = Db::name('mental_xlzxinfo')->where('id',$id)->find();
        if(empty($data)){
            $this->error();
        }
        $user = \app\common\model\User::where(['id'=>$data['user_id']])->find();
        $data['official_openid'] = $user['official_openid'];

        $data['province_text'] = Area::where(['id'=>$data['province']])->value('name');
        $data['city_text'] = Area::where(['id'=>$data['city']])->value('name');

        //擅长领域
        $tags_arr = explode(',',$data['tags']);
        $data['tags_text'] = $tags_arr? Tags::whereIn('id',$tags_arr)->column('name'):[];
        //资质证书
        $certificate_arr = explode(',',$data['certificate']);
        $data['certificate_text'] = $certificate_arr? Certificate::whereIn('id',$certificate_arr)->column('name'):[];
//        $data['people_num'] = Exchangecode::where(['zx_xlzxinfoid'=>$data['id'],'status'=>1])->count();
//        $people_hour = Exchangecode::where(['zx_xlzxinfoid'=>$data['id'],'status'=>1])->sum('zx_minutes');
//        $data['people_hour'] = bcMath($people_hour,60,'/',1);

        $data['image'] = compatImage($data['image']);
        $data['id_number_pic_zheng'] = !empty($data['id_number_pic_zheng']) ? compatImage($data['id_number_pic_zheng']):'';
        $data['id_number_pic_fan'] = !empty($data['id_number_pic_fan']) ? compatImage($data['id_number_pic_fan']):'';

        //people_num 咨询人数
        $data['people_num'] = Db::name('consult_order')->where(['status'=>3,'xlzxinfo_id'=>$data['id']])->count();
        //people_hour 咨询时长
        $data['people_hour'] = Db::name('consult_order')->where(['status'=>3,'xlzxinfo_id'=>$data['id']])->sum('minutes');

        $this->success('成功',$data);
    }
    
    
    /**
     * 类型列表(addons/mental/xlzxinfo/typelist)
     */
    public function typelist()
    {
        $list = Db::name('mental_xlzxinfo_type')->select();
        $this->success('成功',$list);
    }
    
    
    /**
     * 擅长领域列表(addons/mental/xlzxinfo/tagslist)
     */
    public function tagslist()
    {
        $list = Db::name('mental_xlzxinfo_tags')->select();
        $this->success('成功',$list);
    }
    /**
     * 资质列表(addons/mental/xlzxinfo/certificatelist)
     */
    public function certificatelist()
    {
        $list = Db::name('mental_xlzxinfo_certificate')->select();
        $this->success('成功',$list);
    }

    /**
     * 类型详情(addons/mental/xlzxinfo/settypedetails)
     * @param int $id 类型id
     */
    public function typedetails()
    {
        $id = $this->request->param('id');
        $data = Db::name('mental_xlzxinfo_type')->where('id',$id)->find();
        
        $this->success('成功',$data);
    }

    /*
 * 咨询师列表
 * */
    public function xlzxinfo_list()
    {
        $pagesize = $this->request->param('pagesize', 100);
        $tags = $this->request->param('tags', '');
        $typeStr = $this->request->param('typeStr', 0);
        $gender = $this->request->param('gender', 0);
        $certificate = $this->request->param('certificate', 0);
        $keywords = $this->request->param('keywords', '');
//        $where['is_del']= 0;
        $where['status']= 1;
        if ($typeStr){
            $where['typeStr'] = $typeStr;
        }
        if ($gender){
            $where['gender'] = $gender;
        }
        if ($certificate){
            $where[]=["exp",Db::raw("FIND_IN_SET('$certificate',certificate)")];
        }
        if (!empty($tags)){
            $where[]=["exp",Db::raw("FIND_IN_SET('$tags',tags)")];
        }
        if (!empty($keywords)){
//            $where[]=["exp",Db::raw("name like %$keywords%")];
//            $where[] = ["full_name", "like", "%".$keywords."%"];
            $where['full_name'] = ["like", "%".$keywords."%"];
        }
//        dump($where);
        $list = XizxinfoModel::where($where)
            ->order('weigh','desc')
            ->paginate($pagesize);
        if ($list){
            foreach ($list as $key=>&$value){
                $arr = explode(',',$value['tags']);
                $value['tags_arr'] = Tags::whereIn('id',$arr)->select();
                $arr2 = explode(',',$value['certificate']);
                $value['certificate_arr'] = Certificate::whereIn('id',$arr2)->select();

                //people_num 咨询人数
                $value['people_num'] = Db::name('consult_order')->where(['status'=>3,'xlzxinfo_id'=>$value['id']])->count();
                //people_hour 咨询时长
                $value['people_hour'] = Db::name('consult_order')->where(['status'=>3,'xlzxinfo_id'=>$value['id']])->sum('minutes');
            }
        }
        $this->success('成功', $list);
    }

    /**
     * 心里咨询师信息修改(addons/mental/xlzxinfo/update)
     * @param int $id 咨询师id
     */
    public function update()
    {
        //$call_price_15 = $this->request->param('call_price_15',0);
        //$call_price_30 = $this->request->param('call_price_30',0);
        //$call_price_60 = $this->request->param('call_price_60',0);
        //$chat_price_15 = $this->request->param('chat_price_15',0);
        //$chat_price_30 = $this->request->param('chat_price_30',0);
        //$chat_price_60 = $this->request->param('chat_price_60',0);
        $full_name = $this->request->param('full_name',0);

        $work_year = $this->request->param('work_year',0);
        $tags = $this->request->param('tags','');
        $certificate = $this->request->param('certificate','');
        $des = $this->request->param('des','');
        $experience = $this->request->param('experience','');
        $image = $this->request->param('image','');
        $gender = $this->request->param('gender',0);
        $is_online = $this->request->param('is_online');

        $uid = $this->auth->id;
        $data = XizxinfoModel::where('user_id',$uid)->find();
        if (!$data){
            $this->error('不是咨询师');
        }

        // if ($call_price_15<0||$call_price_30<0||$call_price_60<0||$chat_price_15<0||$chat_price_30<0||$chat_price_60<0){
        //     $this->error('金额不能小于0');
        // }
        // if ($call_price_15<0||$chat_price_15<0){
        //     $this->error('金额不能小于0');
        // }
        // if ($call_price_15){
        //     $data->call_price_15 = $call_price_15;
        // }
        // // if ($call_price_30){
        // //     $data->call_price_30 = $call_price_30;
        // // }
        // // if ($call_price_60){
        // //     $data->call_price_60 = $call_price_60;
        // // }
        // if ($chat_price_15){
        //     $data->chat_price_15 = $chat_price_15;
        // }
        // if ($chat_price_30){
        //     $data->chat_price_30 = $chat_price_30;
        // }
        // if ($chat_price_60){
        //     $data->chat_price_60 = $chat_price_60;
        // }
        if ($full_name){
            $data->full_name = $full_name;
        }
        if ($work_year){
            $data->work_year = $work_year;
        }
        if ($tags){
            $data->tags = $tags;
        }
        if ($certificate){
            $data->certificate = $certificate;
        }
        if ($des){
            $data->des = $des;
        }
        if ($experience){
            $data->experience = $experience;
        }
        if ($image){
            $data->image = $image;
        }
        if (!empty($gender)){
            $data->gender = $gender;
        }
        if (isset($is_online)){
            $data->is_online = $is_online;
        }
        $data->save();
        if(!empty($image)){
            $usertoken = Ims::update_user_check($uid);
        }

        $this->success('成功',$data);
    }


    // 咨询师设置
    public function setup()
    {
        $call_price_15 = $this->request->param('call_price_15',0);
        $chat_price_15 = $this->request->param('chat_price_15',0);
        $package_price = $this->request->param('package_price',0); //套餐价格
        $is_enable = $this->request->param('is_enable','');//
        $reset_start_time = $this->request->param('reset_start_time','');
        $reset_end_time = $this->request->param('reset_end_time','');
        $introduce = $this->request->param('introduce','');

        $uid = $this->auth->id;
        $data = XizxinfoModel::where('user_id',$uid)->find();
        if (!$data){
            $this->error('不是咨询师');
        }

        if ($call_price_15<0 || $chat_price_15<0){
            $this->error('金额不能小于0');
        }
        if (!empty($call_price_15)){
            $data->call_price_15 = $call_price_15;
        }
        if (!empty($chat_price_15)){
            $data->chat_price_15 = $chat_price_15;
        }
        if(!empty($package_price)){
            $data->package_price = $package_price;
        }
        if (!empty($is_enable)){
            $data->is_enable = $is_enable;
        }
        if(!empty($reset_start_time)){
            $data->reset_start_time = $reset_start_time;
        }
        if(!empty($reset_end_time)){
            $data->reset_end_time = $reset_end_time;
        }
        if(!empty($introduce)){
            $data->introduce = $introduce;
        }
        $data->save();
        $this->success('成功',$data);
    }

    /**
     * [send_message description]
     * @return [type] [description]
     */
    public function send_message(){
        $xlzxsid = $this->request->get('xlzxsid');
        $userid = $this->request->get('userid');
        $content = $this->request->get('content');
        if(empty($xlzxsid) || empty($userid) || empty($content)){
            $this->error('参数有误');
        }
        $zxs_id = str_replace("zxs","",$xlzxsid);
        $zxs_user_id = Db::name('mental_xlzxinfo')->where('id',$zxs_id)->value('user_id');
        $ret = \addons\mental\model\WxUser::push_template_messsage($zxs_user_id,$userid,$content);
        if($ret){
            $this->success('成功');
        }else{
            $this->error();
        }
    }


    /**
     * 每次打开聊天窗口，自动发送消息
     * [every_message description]
     * @return [type] [description]
     */
    public function every_message(){

        $this->success('成功');
        
        $xlzxsid = $this->request->get('xlzxsid');
        $userid = $this->request->get('userid');
        if(empty($xlzxsid) || empty($userid)){
            $this->error('参数有误');
        }
        $content = '首次聊天消息';
        $ret = \addons\mental\model\WxUser::everyIm($xlzxsid,$userid,$content);
        if($ret){
            $this->success('成功');
        }else{
            $this->error();
        }
    }




    // 用户查询  咨询师是否有套餐
    public function package_isset(){
        $user_id = $this->request->param('user_id');
        $typeId = $this->request->param('typeId',0);
        if (!$user_id){
            $this->error('参数有误');
        }
        $zxs = Db::name('mental_xlzxinfo')->where('user_id',$user_id)->where('status',1)->find();
        if(empty($zxs)){
            $this->error('咨询师不存在');
        }
        $wherePackage['zxs_id'] = $zxs['id'];
        if(!empty($typeId)){
            $wherePackage['typeId'] = $typeId;
        }
        $package_list = Package::where($wherePackage)->select();
        $this->success('成功',$package_list);
    }


    // 咨询师套餐
    public function package_list(){
        $zxs_id = $this->request->param('id');
        if (!$zxs_id){
            $this->error('参数有误');
        }
        $package_list = Package::where(['zxs_id'=>$zxs_id])->select();
        $this->success('成功',$package_list);
    }

    //咨询师套餐详情  
    public function detail_package(){
        $package_id = $this->request->param('id');
        if (!$package_id){
            $this->error('参数有误');
        }
        $package = Package::get($package_id);
        $this->success('成功',$package);
    }

    // 咨询师套餐添加 post
    public function add_package(){
        $zxs = Db::name('mental_xlzxinfo')->where('user_id',$this->auth->id)->where('status',1)->find();
        if(empty($zxs)){
            $this->error();
        }
        $typeId = $this->request->post('typeId');
        if (!$typeId){
            $this->error('套餐类型不能为空');
        }
        if(!in_array($typeId,[1,2])){
            $this->error('套餐类型不合理');
        }
        $package_name = $this->request->post('package_name');
        $package_content = $this->request->post('package_content');
        $package_duration = $this->request->post('package_duration');
        $package_original_price = $this->request->post('package_original_price');
        $package_price = $this->request->post('package_price');
        $package_expiration_month = $this->request->post('package_expiration_month');
        $package_count = Package::where(['zxs_id'=>$zxs['id'],'typeId'=>$typeId])->count();
        if($package_count>=2){
            $this->error('各类型套餐最多支持两条');
        }
        $arr = [
            'zxs_id'=>$zxs['id'],
            'typeId'=>$typeId,
            'package_name'=>$package_name,
            'package_content'=>$package_content,
            'package_duration'=>$package_duration,
            'status'=>1,
            'package_original_price'=>$package_original_price,
            'package_price'=>$package_price,
            'package_expiration_month'=>$package_expiration_month,
            'createtime'=>time(),
            'updatetime'=>time(),
        ];
        $ret = Package::insert($arr);
        if($ret){
            $this->success('添加成功');
        }
        $this->error('失败');
    }



    // 咨询师套餐编辑 post
    public function edit_package(){
        $package_id = $this->request->post('id');
        if (!$package_id){
            $this->error('参数有误');
        }
        $p_info = Package::get($package_id);
        $typeId = $this->request->post('typeId');
        if(!in_array($typeId,[1,2])){
            $this->error('套餐类型不合理');
        }
        $package_name = $this->request->post('package_name');
        $package_content = $this->request->post('package_content');
        $package_duration = $this->request->post('package_duration');
        $package_original_price = $this->request->post('package_original_price');
        $package_price = $this->request->post('package_price');
        $package_expiration_month = $this->request->post('package_expiration_month');

        $p_info->typeId = $typeId;
        $p_info->package_name = $package_name;
        $p_info->package_content = $package_content;
        $p_info->package_duration = $package_duration;
        $p_info->package_original_price = $package_original_price;
        $p_info->package_price = $package_price;
        $p_info->package_expiration_month = $package_expiration_month;

        $ret = $p_info->save();
        if($ret){
            $this->success('编辑成功');
        }
        $this->error('失败');
    }


    // 咨询师套餐删除 post
    public function remove_package(){
        $package_id = $this->request->post('id');
        if (!$package_id){
            $this->error('参数有误');
        }
        $p_info = Package::get($package_id);
        $ret = $p_info->delete();
        if($ret){
            $this->success('删除成功');
        }
        $this->error('失败');
    }

    /**
     * 咨询师方向评估
     * @return void
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function assessment()
    {

        if ($this->request->isPost()) {
            $uid = $this->auth->id;

            $arr =  $this->request->post();
            $full_name = $arr['full_name'];
            $age = $arr['age'];
            $sex = $arr['sex'];
            $mbti = $arr['mbti'];
            $jcgh = $arr['jcgh'];
            $major =$arr['major'];
            $consult_area = $arr['consult_area']?implode(',',$arr['consult_area']):'';
            $consult_area_other = $arr['consult_area_other'];
            $undergo =$arr['undergo'];
            $core_skills =  $arr['core_skills']?implode(',',$arr['core_skills']):'';
            $core_skills_other = $arr['consult_area_other'];
            $solve_complex_problems = $arr['solve_complex_problems'];
            $people_interest = $arr['people_interest']?implode(',',$arr['people_interest']):'';
            $people_interest_other =$arr['people_interest_other'];
            $intensive_study = $arr['intensive_study'];
            $personal_values = $arr['personal_values']?implode(',',$arr['personal_values']):'';
            $life_experience = $arr['life_experience']?implode(',',$arr['life_experience']):'';
            $life_experience_other = $arr['life_experience_other'];
            $visitor_type = $arr['visitor_type'];
            $consultant_type =$arr['consultant_type'];

            $zxs = Db::name('mental_xlzxinfo')->where('user_id',$uid)->find();
            $arr = [
                'user_id'=>$uid,
                'zxs_id'=>$zxs['id'],
                'create_time'=>time(),
                'full_name'=>$full_name,
                'age'=>$age,
                'sex'=>$sex,
                'mbti'=>$mbti,
                'jcgh'=>$jcgh,
                'major'=>$major,
                'consult_area'=>$consult_area,
                'consult_area_other'=>$consult_area_other,
                'undergo'=>$undergo,
                'core_skills'=>$core_skills,
                'core_skills_other'=>$core_skills_other,
                'solve_complex_problems'=>$solve_complex_problems,
                'people_interest'=>$people_interest,
                'people_interest_other'=>$people_interest_other,
                'intensive_study'=>$intensive_study,
                'personal_values'=>$personal_values,
                'life_experience'=>$life_experience,
                'life_experience_other'=>$life_experience_other,
                'visitor_type'=>$visitor_type,
                'consultant_type'=>$consultant_type,
            ];

            $data = Db::name('mental_xlzxinfo_assessment')->where('user_id',$uid)->find();
            if ($data) {
                $ret = Db::name('mental_xlzxinfo_assessment')->where('id',$data['id'])->update($arr);
            }else {
                $ret = Db::name('mental_xlzxinfo_assessment')->insert($arr);
            }
            if ($ret) {
                $this->success('提交成功');
            }
            $this->error('失败');
        }
        $zxs_info = Db::name('mental_xlzxinfo')->where('user_id',$this->auth->id)->where('status',1)->find();
        if (empty($zxs_info)){
            $this->error('咨询师信息有误');
        }
        $data = [];
        $data['full_name'] = $zxs_info['full_name'];
        $data['mbti'] = '';
        $data['jcgh'] = '';
        $zxs_assessment =  Db::name('mental_xlzxinfo_assessment')->where(['user_id'=>$this->auth->id,'zxs_id'=>$zxs_info['id']])->find();
        if(empty($zxs_assessment)){
            //mbti
            $data['mbti'] = Db::name('mental_testlog')->where('user_id',$this->auth->id)->where(['main_id'=>21,'status'=>'finish'])->order('id desc')->value('resultStr');
            //借船过河 结果
            $jcgh = Db::name('mental_testlog')->where('user_id',$this->auth->id)->where(['main_id'=>25,'status'=>'finish'])->order('id desc')->find();
            if(!empty($jcgh)){
                $a = $jcgh['result_log'];
                $b = str_replace("&quot;",'"',$a);
                $aa = json_decode($b,true);
                if(!empty($aa[0]['userAnswer'])){
                    $data['jcgh'] = $aa[0]['userAnswer'][0].$aa[0]['userAnswer'][1].$aa[0]['userAnswer'][2].$aa[0]['userAnswer'][3].$aa[0]['userAnswer'][4];
                }
            }
        }else{
            $data = $zxs_assessment;
            if(!empty($data['consult_area'])){
               $data['consult_area'] = explode(',',$data['consult_area']);
            }
            if(!empty($data['core_skills'])){
                $data['core_skills'] = explode(',',$data['core_skills']);
            }
            if(!empty($data['people_interest'])){
                $data['people_interest'] = explode(',',$data['people_interest']);
            }
            if(!empty($data['personal_values'])){
                $data['personal_values'] = explode(',',$data['personal_values']);
            }
            if(!empty($data['life_experience'])){
                $data['life_experience'] = explode(',',$data['life_experience']);
            }
        }
        $this->success('查询成功',$data);
    }
}
